package util;

import java.util.Calendar;

public class Week {

	Calendar cal = Calendar.getInstance();

	static Calendar first = null;
	public static Calendar getFirst(){
		Calendar first = Calendar.getInstance();
	    first.add(Calendar.DAY_OF_WEEK, 
	              first.getFirstDayOfWeek() - first.get(Calendar.DAY_OF_WEEK));
	    return first;
	}
	
	public static Calendar getLast(){
		if (first==null) first=getFirst();
		Calendar last = (Calendar) first.clone();
	    last.add(Calendar.DAY_OF_YEAR, 6);
	    return last;
	}
}

